package com.ifinc.common.protocol.i8583.field;

import com.ifinc.common.protocol.i8583.I8583Request;

/**
 * User: luotao
 * Date: 13-11-15
 * Time: 13:39
 */
public interface Field {

    String BCD = "BCD";

    String ASC = "ASC";

    String VAR = "VAR";

    String COMP="COMP";

    public byte[] toByte();

    public byte[] toMacByte();

    public void setSrcValue(String value);

    public String getFieldType();

    public byte[] getSrcBytes();

    public void setProtocol(I8583Request i8583Request);

    public void setFieldId(Integer id);

    public Integer getFieldId ();

    /**
     * 是否自动填写字段的指
     * @return
     */
    public boolean isAutoFill();

    /**
     * 是否参与BITMap运算
     * @return
     */
    public boolean joinBitMap();

    /**
     * 校验数据格式
     */
    public void verify();

    public int toValue(byte[] data,int index);

    public int getEncodeLen();
}
